package com.qianli.user.domain.facatory;

import com.qianli.user.domain.model.UserAccessModel;
import com.qianli.user.domain.respository.UserAccessRespository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * name:登录信息
 * auth:ting.li@qianli-inc.com
 * date:2018/1/2 15:49
 * version: v1.0.0
 **/
@Service
public class UserAccessFactory {

    @Autowired
    private UserAccessRespository accessRespository;

    /**
     * 加载模型
     * @param userAccessModel
     */
    public void load(UserAccessModel userAccessModel){
        accessRespository.load(userAccessModel);
    }

    /**
     * 注册
     * @param userAccessModel
     */
    public void register(UserAccessModel userAccessModel){
        accessRespository.store(userAccessModel);
    }

    /**
     * 登录
     * @param userAccessModel
     */
    public void login(UserAccessModel userAccessModel){
        accessRespository.restore(userAccessModel);
    }

}
